package chuangyi.com.org.ViewModel;

import android.app.Activity;
import android.content.Context;
import android.view.View;

/**
 * Created by zxh on 16/12/19.
 */

public class DialogModel extends ContextObservable {

    public DialogModel(Context context) {
        super(context);
    }

    public void onClickCancel(View view) {
        Activity activity = (Activity) getContext();
        activity.setResult(Activity.RESULT_CANCELED);
        activity.finish();
    }

    public void onClickOk(View view) {
        Activity activity = (Activity) getContext();
        activity.setResult(Activity.RESULT_OK);
        activity.finish();
    }

    public void onClickGoBack(View view) {
        Activity activity = (Activity) getContext();
        activity.setResult(Activity.RESULT_OK);
        activity.finish();
    }
}
